package org.example.pattern.factory.simple;

/**
 * @Author zhangjg
 * @Date 2021/9/17 20:34
 * @Description
 **/
public class FruitFactory {

    public Fruit getFruit(int type) {
        Fruit fruit = null;
        if (type == 1) {
            fruit = new Apple();
        } else if (type == 2) {
            fruit = new Banana();
        }
        return fruit;
    }

}
